/*
 * @Author: luoqi
 * @Date: 2022-03-28 11:21:09
 * @LastEditors: luoqi
 * @LastEditTime: 2022-03-28 11:37:23
 * @Description: 
 */
//config-overrides.js文件内容
const {
  override,
  addPostcssPlugins,
  fixBabelImports,
  addLessLoader
} = require("customize-cra");
// 关掉 sourceMap
process.env.GENERATE_SOURCEMAP = process.env.NODE_ENV === 'development' ? 'true' : 'false';

module.exports = override(
  addPostcssPlugins([
      require("postcss-normalize")({
          "forceImport": true
      }),
      require("postcss-preset-env")({
          "stage": 0
      }),
  ]),
  fixBabelImports('import', {
      libraryName: 'antd',
      libraryDirectory: 'es',
      style: true
  }),
  addLessLoader({
    // javascriptEnabled: true,
    lessOptions: {
      modifyVars: {//需要修改的属性
        "primary-color": "#382c77",
        'link-color': '#382c77',
        'text-color': '#666666',
        'error-color': '#db2a36',
        'success-color': '#1b733e',
        'waring-color': '#ffd00b',
        'heading-color': '#272933'
      },
      javascriptEnabled: true,
    }
    //下面这行很特殊，这里是更改主题的关键，这里我只更改了主色，当然还可以更改其他的，下面会详细写出。
  })
);